Conversation
SeunginLyu
left a comment
There was a problem hiding this comment.
Nicely Done! It looks really good overall. I made some stylistic suggestions that might be helpful. Keep up the good work!
| import random | ||
| from amino_acids import aa, codons, aa_table # you may find these useful | ||
| from load import load_seq | ||
| dna = load_seq("./data/X73525.fa") |
There was a problem hiding this comment.
While the logic here is similar for both import and load_seq, the former is a module import statement while the latter is a function call. It is conventional to keep import statements separate from the rest of the code. In this case, load_seq should be in __main__
| complement_strand = complement_strand + 'A' | ||
| if pair == 'G': | ||
| complement_strand = complement_strand + 'C' | ||
| #print (complement_strand) |
There was a problem hiding this comment.
please remove comments for the final code
| strand_length -= 1 #moves backwards | ||
| return (rev_complement) | ||
| # TODO: implement this | ||
| pass |
There was a problem hiding this comment.
These are simple placeholders, so no need to leave them in your final code
| >>> rest_of_ORF("ATGAGATAGG") | ||
| 'ATGAGA' | ||
|
|
||
| >>> rest_of_ORF("TAG") |
| """ | ||
| #stop codons are TAA, TAG, TGA | ||
| # TODO: implement this | ||
| #stop_codons = ['TAA','TAG','TGA'] |
| if dna[i:i+3] in stop_codons: #stop if you find a stop codon | ||
|
|
||
| return dna[0:i] #return dna before the codon | ||
|
|
There was a problem hiding this comment.
I like your inline comments. But you don't need to write them for every line if you feel like you are spending too much time explaining trivial things into words.
| returns: a list of non-nested ORFs | ||
| >>> find_all_ORFs_oneframe("ATGCATGAATGTAGATAGATGTGCCC") | ||
| ['ATGCATGAATGTAGA', 'ATGTGCCC'] | ||
| >>> find_all_ORFs_oneframe("ATGATGCATGAATGTAGATAGATGTGCCC") |
| >>> longest_ORF("ATGCGAATGTAGCATCAAA") | ||
| 'ATGCTACATTCGCAT' | ||
| """ | ||
| return max(find_all_ORFs_both_strands(dna), key=len); #returns longest orf |
| """ | ||
| max_orf = "" | ||
| temp = "" | ||
| for i in range(0, num_trials): |
There was a problem hiding this comment.
one stylistic convention. for _ in range(0, num_trials):
I would like some feedback on my genefinder project.